﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

namespace OnlineSoccerManager
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        public App()
        {
            this.Startup += AppStartup;
        }

        void AppStartup(object sender, StartupEventArgs e)
        {
            // create new Main Widnow
            MainWindow mainWindow = new MainWindow();
            // create DataContext for Window to enable {Binding <PropertyName>}
            MainViewModel dataContext = new MainViewModel();

            // assign DataContext to MainWindow
            mainWindow.DataContext = dataContext;

            // set Window as Application Mainwindow
            this.MainWindow = mainWindow;

            // show window
            mainWindow.Show();

        }
    }
}
